package com.wang.interview.tests.lists;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;

/**
 * @author: wang
 * @date: 2021/8/5 16:42
 * @description: 排序
 */
public class L1 {
    public static void main(String[] args) {

        ArrayList<Integer> arrayList = new ArrayList<>(Arrays.asList(1, 2, 3));
        arrayList.sort(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2 - o1;
            }
        });
        System.out.println(arrayList);
        System.out.println(Arrays.toString(arrayList.stream().sorted().toArray()));
    }
}
